import MonthSlider from '@/components/slider/MonthSilder';
import style from "./style.module.scss";
import { useMonthStore } from "@/stores/monthStore";
import type { StoreInfo } from '@/Interface/StoreInfoInterface';
import Costs from '../echarts/CostsBarChart';
import { useBasicDataStore } from '@/stores/basicDataStore';


export default function TurnOver() {

  const basicData = useBasicDataStore(status => status.basicData) as StoreInfo
  const curMonth = useMonthStore(status => status.month)

  const monthRevenue = ((basicData.monthlyData[curMonth - 1].totalRevenue) / 10000).toFixed(2)
  return (
    <>
      <div className={`${style.size} ${style.monthAnalysis}`}>
        <h4>{curMonth}月份总收入：{monthRevenue} 万元</h4>
        <Costs />
        <div className={style.slider}>
          <MonthSlider />
        </div>
      </div>
    </>
  )
}